﻿''' <summary>
''' 绘制单个风玫瑰图
''' </summary>
''' <remarks></remarks>
Public Class Circle
    Inherits WindBase
    Protected m_Location As PointF

    Public SmoothingMode As Boolean = False

    ''' <summary>
    ''' 间距
    ''' </summary>
    ''' <remarks></remarks>
    Private m_Interval As Double = 2
    ''' <summary>
    ''' 圆圈的个数
    ''' </summary>
    ''' <remarks></remarks>
    Private m_Count As Integer = 6
    Private m_CircleAxes As New CircleAxes
    Private m_CircleGrids As New CircleGrids
    Private m_CircleAxesTitle As New CircleAxesTitle
    Private m_BottomTitle As New BottomTitle
    Private m_CircleLable As New CircleLable
    Private m_RoseLine As New RoseLine
    'Private m_Winds As New Winds '绘制风向的类
    Private m_Legend As New Legend '图例

    Private m_CheckDreFre As Boolean '判断是风速图/风频图

    ''' <summary>
    ''' 每个玫瑰图的原点位置
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Location() As PointF
        Get
            Return m_Location
        End Get
        Set(ByVal value As PointF)
            m_Location = value
        End Set
    End Property
    ''' <summary>
    ''' 间隔
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Interval() As Double
        Get
            Return m_Interval
        End Get
        Set(ByVal value As Double)
            m_Interval = value
        End Set
    End Property
    ''' <summary>
    ''' 圆圈的个数
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Count() As Integer
        Get
            Return m_Count
        End Get
        Set(ByVal value As Integer)
            m_Count = value
        End Set
    End Property
    ''' <summary>
    ''' 绘制圆的坐标的对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CircleAxes() As CircleAxes
        Get
            Return m_CircleAxes
        End Get
        Set(ByVal value As CircleAxes)
            m_CircleAxes = value
        End Set
    End Property
    ''' <summary>
    ''' 绘制圆的网格点的对象
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CircleGrids() As CircleGrids
        Get
            Return m_CircleGrids
        End Get
        Set(ByVal value As CircleGrids)
            m_CircleGrids = value
        End Set
    End Property
    ''' <summary>
    ''' 坐标的标题
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CircleAxesTitle() As CircleAxesTitle
        Get
            Return m_CircleAxesTitle
        End Get
        Set(ByVal value As CircleAxesTitle)
            m_CircleAxesTitle = value
        End Set
    End Property
    ''' <summary>
    ''' 底部的月分和静风
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property BottomTitle() As BottomTitle
        Get
            Return m_BottomTitle
        End Get
        Set(ByVal value As BottomTitle)
            m_BottomTitle = value
        End Set
    End Property
    Property CircleLable() As CircleLable
        Get
            Return m_CircleLable
        End Get
        Set(ByVal value As CircleLable)
            m_CircleLable = value
        End Set
    End Property

    ''' <summary>
    ''' 图例
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Legend() As Legend
        Get
            Return m_Legend
        End Get
        Set(ByVal value As Legend)
            m_Legend = value
        End Set
    End Property
    ''' <summary>
    ''' 风玫瑰线
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property RoseLine() As RoseLine
        Get
            Return m_RoseLine
        End Get
        Set(ByVal value As RoseLine)
            m_RoseLine = value
        End Set
    End Property
    ''' <summary>
    ''' 判断是风速图/风频图
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CheckDreFre() As Boolean
        Get
            Return m_CheckDreFre
        End Get
        Set(ByVal value As Boolean)
            m_CheckDreFre = value
        End Set
    End Property


    Public Sub Draw(ByVal grap As Graphics, ByVal BackColor As Color, ByVal ArryWindData() As Double, ByVal m_RoseCheck As Boolean, ByVal strMonth As String)
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''    '''''
        If SmoothingMode = True Then '消除锯齿
            grap.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
        End If
        m_CircleAxes.Draw(grap, m_Interval, m_Count, m_Location)
        m_CircleGrids.Draw(grap, Me.m_Interval * m_Count, m_Location)
        m_CircleAxesTitle.DrawTitle(grap, Me.m_Interval * m_Count, m_Location)
        m_BottomTitle.DrawTitle(grap, Me.m_Interval * m_Count, m_Location, m_CircleAxesTitle.TitleFont, strMonth)
        m_CircleLable.Draw(grap, m_Interval, m_Count, BackColor, m_Location, CheckDreFre)
        m_RoseLine.Draw(grap, ArryWindData, m_Location, m_RoseCheck)

        'm_Winds.Draw(grap, m_Calm)
        'm_Legend.DrawLegend(grap, m_Winds.ArraySpeedAndCorlors, 0, 0, 10)
    End Sub
End Class
